<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../js/vue.js"></script>
</head>

<body>
    <div id="app">
        用户名:<input :value="username" id="username">

        <button @click="setusername">点击设置更新</button>

    </div>
</body>
<script>
    new Vue({
        el: "#app",
        data: {
            username: "zzz",
        },

        methods: {
            setusername() {
                let usernameinp = document.getElementById("username");
                this.username = "aaaa";
                console.log(usernameinp.value);

                this.$nextTick(() => {
                    console.log(usernameinp.value);
                })
            }
        }

    })



</script>

</html>